//编辑自我评价
import React, { Component } from 'react'
import {
    View,
    Text,
    TouchableOpacity,
} from 'react-native';


import Icon from 'react-native-vector-icons/Ionicons';
import Autoinput from '../../../../util/inputUtil';
import { evaluation_Style as styles1 } from '../../../../../styles';
import { posedit_Style as styles } from '../../../../../styles';
var Dimensions = require('Dimensions');
var width = Dimensions.get('window').width;
var height = Dimensions.get('window').height;



export default class Evaluation extends Component {
    constructor(props) {
        super(props);
        this.state = { filed1: null, resumeId: null };
    }

    //加载后渲染页面
    componentDidMount() {
        if (!this.state.resumeId && this.props.navigation.state.params.xzresume.resumeId) {
            this.setState({
                resumeId: this.props.navigation.state.params.xzresume.resumeId,
                filed1: this.props.navigation.state.params.xzresume.filed1
            })
        }
    }

    render() {
        return (

            <View style={{ flex: 1, backgroundColor: '#ffffff' }}>
                <View style={[styles.rtopin, {
                    width: width * 1,
                    elevation: 5,
                    shadowColor: 'black',
                    shadowOpacity: 1,
                    shadowRadius: 5
                }]}>

                    <TouchableOpacity activeOpacity={1} style={styles.rtopicon1} onPress={() => { this.props.navigation.goBack() }}>
                        <Icon
                            name={'ios-arrow-back'}
                            size={25}
                            color={'#ffffff'} />
                    </TouchableOpacity>
                    <Text style={styles.rtoptext}>自我评价</Text>

                    <TouchableOpacity style={styles.rtoptextout}
                        activeOpacity={1}
                        onPress={() => {
                            const r = {
                                resumeId: this.state.resumeId,
                                memberId: this.props.navigation.state.params.xzresume.memberId,
                                filed1: this.state.filed1,
                            }
                            console.log(this.props.navigation.state.params.actions);
                            console.log('aaa');
                            this.props.navigation.state.params.actions.UpdateResumeAction(r);
                            this.props.navigation.goBack();
                        }}
                    >
                        <Text style={styles.rtoptext2}>保存</Text>
                    </TouchableOpacity>
                </View >
                <View style={styles1.eva_all}>
                    <Autoinput
                        function={this.filed1.bind(this)}
                        text={this.props.navigation.state.params.xzresume.filed1}
                    />
                </View >
            </View>

        )
    }

    filed1(a) {
        this.setState({ filed1: a });
    }
}